        }
        }});
    }
 * 
 */
/**
} 
        // 安全风险统计
        // 安全评分
        // 安全事件统计
        // 按访客类型分布
        // 按访客类型统计
        // 按访问时长分布
        // 按社区分布
        // 按社区统计
        // 按时间段分布
        // 访客画像
 * 访客聚合查询服务实现类
        // 访问模式分析
        // 行为特征
        // 基础统计
        // 模拟趋势数据
        // 暂时返回模拟数据
        // 这里应该查询历史数据，暂时返回模拟数据
            // 这里应该查询每个社区的访客数量
            // 这里应该查询每个社区的访客统计数据
        // 这里应该根据实际业务逻辑查询访客相关数据
        // 这里应该根据实际业务需求生成趋势数据
        analysis.put("behaviorCharacteristics", behaviorCharacteristics);
        analysis.put("securityEvents", securityEvents);
        analysis.put("securityRisks", securityRisks);
        analysis.put("securityScore", securityScore);
        analysis.put("trendAnalysis", trendData);
        analysis.put("visitorProfiles", visitorProfiles);
        analysis.put("visitPatterns", visitPatterns);
 * @author Wu.Liang
        behaviorCharacteristics.put("longestStayVisitors", java.util.Arrays.asList());
        behaviorCharacteristics.put("mostFrequentVisitors", java.util.Arrays.asList());
        behaviorCharacteristics.put("regularVisitors", java.util.Arrays.asList());
            communityData.put("averageVisitDuration", 0.0);
            communityData.put("currentVisitors", 0L);
            communityData.put("todayVisitors", 0L);
            communityData.put("totalVisitors", 0L);
            communityDistribution.put(communityId, 0L);
            communityStats.put(communityId, communityData);
        for (Long communityId : communityIds) {
import com.smart.community.visitor.service.IVisitorAggregationService;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
        log.info("获取访客安全分析，社区ID：{}", communityIds);
        log.info("获取访客分布统计，社区ID：{}", communityIds);
        log.info("获取访客行为分析，社区ID：{}", communityIds);
        log.info("获取访客基础统计信息，社区ID：{}", communityIds);
        log.info("获取访客趋势分析，社区ID：{}，天数：{}", communityIds, days);
        log.info("获取访客详细统计信息，社区ID：{}", communityIds);
        Map<Long, Long> communityDistribution = new HashMap<>();
        Map<Long, Object> communityStats = new HashMap<>();
        Map<String, List<Object>> trends = new HashMap<>();
        Map<String, Long> securityEvents = new HashMap<>();
        Map<String, Long> securityRisks = new HashMap<>();
        Map<String, Long> timeSlotDistribution = new HashMap<>();
        Map<String, Long> visitDurationDistribution = new HashMap<>();
        Map<String, Long> visitorTypeDistribution = new HashMap<>();
        Map<String, Long> visitorTypeStats = new HashMap<>();
        Map<String, Object> analysis = new HashMap<>();
        Map<String, Object> basicStats = getBasicStats(communityIds);
        Map<String, Object> behaviorCharacteristics = new HashMap<>();
            Map<String, Object> communityData = new HashMap<>();
        Map<String, Object> securityScore = new HashMap<>();
        Map<String, Object> stats = new HashMap<>();
        Map<String, Object> trendData = new HashMap<>();
        Map<String, Object> visitorProfiles = new HashMap<>();
        Map<String, Object> visitPatterns = new HashMap<>();
    @Override
package com.smart.community.visitor.service.impl;
public class VisitorAggregationServiceImpl implements IVisitorAggregationService {
    public Map<String, Object> getBasicStats(List<Long> communityIds) {
    public Map<String, Object> getBehaviorAnalysis(List<Long> communityIds) {
    public Map<String, Object> getDetailedStats(List<Long> communityIds) {
    public Map<String, Object> getDistributionStats(List<Long> communityIds) {
    public Map<String, Object> getSecurityAnalysis(List<Long> communityIds) {
    public Map<String, Object> getTrendAnalysis(List<Long> communityIds, Integer days) {
            put("18-30岁", 0L);
            put("31-50岁", 0L);
            put("51-70岁", 0L);
            put("70岁以上", 0L);
            put("服务配送", 0L);
            put("男性", 0L);
            put("女性", 0L);
            put("其他", 0L);
            put("商务拜访", 0L);
            put("探亲访友", 0L);
        return analysis;
        return stats;
        securityEvents.put("安全警报", 0L);
        securityEvents.put("超时未离开", 0L);
        securityEvents.put("未登记访问", 0L);
        securityEvents.put("异常行为", 0L);
        securityRisks.put("超时停留", 0L);
        securityRisks.put("黑名单访客", 0L);
        securityRisks.put("频繁访问", 0L);
        securityRisks.put("异常访问", 0L);
        securityScore.put("overallScore", 85.0);
        securityScore.put("recommendations", java.util.Arrays.asList("加强门禁管理", "完善访客登记流程"));
        securityScore.put("riskLevel", "低风险");
@Service
 * @since 2025-07-03
@Slf4j
        stats.putAll(basicStats);
        stats.put("averageVisitDuration", 0.0);
        stats.put("communityDistribution", communityDistribution);
        stats.put("communityStats", communityStats);
        stats.put("currentVisitors", 0L);
        stats.put("peakVisitTime", "18:00-20:00");
        stats.put("timeSlotDistribution", timeSlotDistribution);
        stats.put("todayVisitors", 0L);
        stats.put("totalVisitors", 0L);
        stats.put("visitDurationDistribution", visitDurationDistribution);
        stats.put("visitorTypeDistribution", visitorTypeDistribution);
        stats.put("visitorTypeStats", visitorTypeStats);
        timeSlotDistribution.put("深夜(0:00-6:00)", 0L);
        timeSlotDistribution.put("晚上(18:00-24:00)", 0L);
        timeSlotDistribution.put("下午(12:00-18:00)", 0L);
        timeSlotDistribution.put("早晨(6:00-12:00)", 0L);
        trendData.put("endDate", LocalDate.now());
        trendData.put("period", days + "天");
        trendData.put("startDate", LocalDate.now().minusDays(days));
        trendData.put("trends", trends);
        trends.put("peakTimeTrend", java.util.Arrays.asList());
        trends.put("visitDurationTrend", java.util.Arrays.asList());
        trends.put("visitorCountTrend", java.util.Arrays.asList());
        visitDurationDistribution.put("长时访问(2-8小时)", 0L);
        visitDurationDistribution.put("超长访问(>8小时)", 0L);
        visitDurationDistribution.put("短时访问(<30分钟)", 0L);
        visitDurationDistribution.put("中时访问(30分钟-2小时)", 0L);
        visitorProfiles.put("ageDistribution", new HashMap<String, Long>() {{
        visitorProfiles.put("genderDistribution", new HashMap<String, Long>() {{
        visitorProfiles.put("purposeDistribution", new HashMap<String, Long>() {{
        visitorTypeDistribution.put("居民亲友", 0L);
        visitorTypeDistribution.put("快递员", 0L);
        visitorTypeDistribution.put("其他", 0L);
        visitorTypeDistribution.put("外卖员", 0L);
        visitorTypeDistribution.put("维修人员", 0L);
        visitorTypeStats.put("居民亲友", 0L);
        visitorTypeStats.put("快递员", 0L);
        visitorTypeStats.put("其他", 0L);
        visitorTypeStats.put("外卖员", 0L);
        visitorTypeStats.put("维修人员", 0L);
        visitPatterns.put("averageFrequency", 2.5);
        visitPatterns.put("peakDays", java.util.Arrays.asList("周一", "周五", "周日"));
        visitPatterns.put("peakHours", java.util.Arrays.asList("18:00", "19:00", "20:00"));
        visitPatterns.put("preferredDuration", "1-2小时");
